#ifndef MODULES_MAP_HDMAP_ADAPTER_ODR_PARSER_CONVERT_CURVE_OFFSET_H_
#define MODULES_MAP_HDMAP_ADAPTER_ODR_PARSER_CONVERT_CURVE_OFFSET_H_

#include "modules/map/hdmap/adapter/odr_parser/data_define.h"

#include "modules/map/proto/map.pb.h"
#include "modules/map/hdmap/adapter/xml_parser/common_define.h"
#include "modules/map/hdmap/adapter/xml_parser/status.h"


namespace apollo {
namespace hdmap {
namespace adapter {

/**
 * Refer to  hdmap_common.cc LaneInfo::Init() about how
 * the s of segment is calculated.
 * LineSegment2d::LineSegment2d() calucates distance of two points in segment.
 * Then get the s offset of segment.
 */
class ConvertCurveOffset {
public:
  static void FixCurveOffset(LaneInternal& lane_internal);

private:
  static void FixCurve(PbCurve* curve, bool is_center_curve);
  static double PointDistance(const PbPoint3D& start, const PbPoint3D& end);
};

}
}
}
#endif //MODULES_MAP_HDMAP_ADAPTER_ODR_PARSER_CONVERT_CURVE_OFFSET_H_